<?php
namespace Home\Controller;
use Think\Controller;
class UservipController extends Controller{
	function reg(){
		if(!empty($_POST)){
		$UservipOb=D('Uservip');
		$_POST['password'] = md5($_POST['password']);
		$_POST['repassword'] = md5($_POST['repassword']);
	    $_POST['regtime']=time();
		$UservipSre=$UservipOb->create();
		if($UservipSre){
			$UservipRe=$UservipOb->add();
			if($UservipRe){
				$this->success("成功",U("Home/Index/index"));
			}else{
				$this->error("失败",U("Home/Uservip/reg"));
			}
			exit();
			}else{
				$UserInfo=$UservipOb->getError();
				$this->assign("UserInfo",$UserInfo);
				$this->assign("arr",$_POST);	
			}
		}
		$this->display();
	}
}

